from models import Collection, Annotation, ChartView, Dataset, Tag, TagMembership
from django.contrib import admin
import users

class DatasetAdmin (admin.ModelAdmin):
	list_display = ('name', 'pub_date', 'source', 'x_units')
	fieldsets = [
		(None,			{'fields' : ['name']}),
		('Submission data',	{'fields' : ['author', 'pub_date'],
					 'classes' : ['collapse']}),
		('Dataset metadata',	{'fields' : ['filename', 'source', 'source_article',
				'source_url', 'start','end', 'x_units','y_units','data_mode']}),
	]

class CollectionAdmin (admin.ModelAdmin):
	list_display = ('name', 'pub_date', 'author')
	fieldsets = [
		(None,			{'fields' : ['name']}),
		('Submission data',	{'fields' : ['author', 'pub_date']}),
		('Collection data',	{'fields' : ['slug', 'published']}),
	]

admin.site.register (Annotation)
admin.site.register (Tag)
admin.site.register (Collection, CollectionAdmin)
admin.site.register (TagMembership)
admin.site.register (ChartView)
admin.site.register (Dataset, DatasetAdmin)
